package cate.game.train.gem.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

import java.util.List;

@OperationSetter(GDOperation.GEM_COMPOSITE)
public class GemGeneralCompositeReq implements MsgInput {
    @NoteField("要合成得tid")
    public int tid;

    @NoteField("消耗的宝石tid")
    public List<Integer> costTids;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.gem.generalComposite(cc.getRole(), tid, costTids);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.GEM_GENERAL_COMPOSITE_REQ;
    }
}
